<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:include="login::nav">
</div>
<div style="display: flex">
<div style="flex: 2">
    <table border="1">
        <tr>
            <th>编号</th>
            <th>课程名称</th>
            <th>操作</th>
        </tr>
        <tr th:each="x:${course}">
            <td th:text="${x.cno}"></td>
            <td th:text="${x.cname}"></td>
            <td><a th:href="'/adm/go2update?cno='+${x.cno}">修改</a></td>
            <td><a th:href="'/adm/del?cno='+${x.cno}">删除</a></td>
        </tr>
    </table>
</div>
    <div style="flex: 1">
        <button><a href="/adm/go2add">添加课程</a></button>
        <hr>
        <div th:if="${action}=='add'">
            <form action="/adm/add" method="post">
                <h2>添加课程</h2>
                课程编号:<input type="text" name="cno"/><br>
                课程名称:<input type="text" name="cname"/><br>
                <input  type="submit"/>
            </form>
    </div>
        <div th:if="${action}=='update'">
            <form action="/adm/update" method="post">
                <h2>修改课程</h2>
                课程编号:<input type="text" name="cno" th:value="${cno}"/><br>
                课程名称:<input type="text" name="cname"/><br>
                <input  type="submit"/>
            </form>
        </div>
</div>
</div>
</body>
</html>